package com.hdoit.apollo.web.shop.modelconfig;

import com.hdoit.apollo.web.shop.providers.ClassifyProvider;
import com.tennetcn.core.common.enums.regular.MathRegularExpressions;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RegularExpressionAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      tancongzhu
 * @email       
 * @createtime  2018年04月26日 11:55:57
 * @comment
 */
public class CustomerConfig extends ModelMetadataAttributeConfiguration{
    public CustomerConfig(){
        this.setProperty("customerName")
            .hasAttribute(new DisplayNameAttribute("姓名"));

        this.setProperty("customerTel")
            .hasAttribute(new DisplayNameAttribute("联系方式"));

        this.setProperty("customerDebt")
            .hasAttribute(new DisplayNameAttribute("欠款数"));

        this.setProperty("customerDebtCargo")
            .hasAttribute(new DisplayNameAttribute("欠货数"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店id"));
        
        this.setProperty("classifyId")
        .hasAttribute(new DropDownListAttribute(new ClassifyProvider()))
        .hasAttribute(new DisplayNameAttribute("客户类型"));

    }
}
